﻿using System;

class Program
{
    static void Main()
    {
        string str = "http://www.devbg.org/forum/index.php";
        int iDots=0;
        int iSlash=0;
        int iSlashes=0;

        for (int i = 0; i < str.Length-2; i++)
        {
            if (str.Substring(i, 1) == ":")
            {
                iDots = i;
            }
            else if (str.Substring(i, 2) == "//")
            {
                iSlashes = i;
                for (int j = i+2; j < str.Length; j++)
                {
                    iSlash = j;
                    break;
                }
            }
        }
        int pLenght = iDots;
        int sLenght = iSlashes+iSlash;
        int rLenght = str.Length - 1-iSlash;
        string protocol = str.Substring(0, pLenght);
        string server = str.Substring(iSlashes + 2, sLenght+1);
        string resource = str.Substring(iSlash + 13, rLenght-12);
        Console.WriteLine(protocol);
        Console.WriteLine(server);
        Console.WriteLine(resource);  
           
    }
}